package cn.wolfcode.luowowo.cloud.common.advice;

import cn.wolfcode.luowowo.cloud.common.exception.BusinessException;
import cn.wolfcode.luowowo.cloud.common.util.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

public class CommonExceptionAdvice {

    @ExceptionHandler(BusinessException.class)
    @ResponseBody
    public Result handle(BusinessException ex){
        ex.printStackTrace();
        return Result.error(ex.getCodeMsg());
    }
}
